package com.study.samsung.Dao.htDao;

import com.study.samsung.Entity.Commodity;
import com.study.samsung.Entity.User;
import com.study.samsung.Entity.htEntity.Admin;
import com.study.samsung.Utils.RowMapper;
import com.study.samsung.Utils.SQLHelper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

public class QuantityDao {
    private SQLHelper helper = new SQLHelper();

    public Integer selectAllUser(){
        String sql = "select count(*) from user";
        Integer one = helper.one(sql, rs -> {
            return rs.getInt(1);
        });
        return one;
    }

//   匿名内部类
    public Integer selectAllBlackMan(){
        String sql = "SELECT COUNT(*) FROM  user WHERE isdel=0;";
        Integer one = helper.one(sql,rs -> {
            return rs.getInt(1);
        });
        return one;
    }
    public Integer selectAllGood(){
        String sql = "select count(*) from commodity";
        Integer one = helper.one(sql,rs -> {
            return rs.getInt(1);
        });
        return one;
    }
    public Integer selectAllAdmin(){
        String sql = "select count(*) from admin";
        Integer one = helper.one(sql,rs -> {
            return rs.getInt(1);
        });
        return one;
    }

}
